package net.vinote.smart.platform.service.handler;

import net.vinote.smart.platform.comm.StringFunction;
import net.vinote.smart.platform.module.database.bo.BizObject;
import net.vinote.smart.platform.service.dw.handler.CommonHandler;
import net.vinote.smart.platform.service.dw.handler.HandlerPerimissionAnnotation;
import net.vinote.smart.platform.service.util.Permission;
import net.vinote.smart.platform.service.util.Permission.PermissionEnum;

/**
 * @author Seer
 * @version AppInfoHandler.java, v 0.1 2015年3月6日 下午7:51:05 Seer Exp.
 */
@HandlerPerimissionAnnotation(
		insert = @Permission(PermissionEnum.SMART_APP_INFO_INSERT),
		update = @Permission(PermissionEnum.SMART_APP_INFO_UPDATE),
		delete = @Permission(PermissionEnum.SMART_APP_INFO_DELETE),
		query = @Permission(PermissionEnum.SMART_APP_INFO_QUERY))
public class AppInfoHandler extends CommonHandler {

	@Override
	public void initDisplayForAdd(BizObject bo) {
		setDefaultValue("subject",
				StringFunction.nullToBlank(request.getParameter("subject")));
	}

	public void initDisplayForEdit() {
		setReadOnly("AppID", true);
	}
}
